#ifndef __MESSAGE_DISPATCHER_HPP__
#define __MESSAGE_DISPATCHER_HPP__

#include <vector>
#include <time.h>

class MMessage;

class MessageDispatcher
{
public:
	static void   createInstance();
	static void   destroyInstance();

	static MessageDispatcher*   getInstance();

	void dispatchMessage(MMessage* pMsg, int senderID, int receiverID);
	void update(clock_t tick);

private:
	MessageDispatcher() {};
	void deliverMessage(MMessage* pMsg, int receiverID);

	static MessageDispatcher* m_pInstance;

	std::vector<MMessage*> m_delayedMessages;
};

#endif //__MESSAGE_DISPATCHER_HPP__

//EOF
